package com.tianji.learning.controller;


import com.tianji.common.domain.dto.PageDTO;
import com.tianji.learning.domain.dto.ReplyDTO;
import com.tianji.learning.domain.query.ReplyPageQuery;
import com.tianji.learning.domain.vo.ReplyVO;
import com.tianji.learning.service.IInteractionReplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 互动问题的回答或评论 前端控制器
 * </p>
 *
 * @author 老李头儿
 * @since 2025-03-27
 */
@RestController
@RequestMapping("/replies")
@Api(tags = "用户端-回答或评论相关接口")
@RequiredArgsConstructor
public class InteractionReplyController {
     private final IInteractionReplyService replyService;
    /**
     * 新增回答或评论
     * @param replyDTO
     */
    @PostMapping
    @ApiOperation("新增回答或评论")
    public void saveReply(@RequestBody ReplyDTO replyDTO){
        replyService.saveReply(replyDTO);
    }


    /**
     * 分页查询回答或评论列表
     * @param replyPageQuery
     */
    @GetMapping("/page")
    @ApiOperation("分页查询回答或评论列表")
    public PageDTO<ReplyVO> pageReply(ReplyPageQuery replyPageQuery){
        return replyService.pageReply(replyPageQuery,false);
    }
}
